﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using wsy.ext.Devlib.ExtensionMethods;

namespace Test
{
    public class Class1
    {
        [Test]
        public void test()
        {
            MyEnum ab = MyEnum.A;
            ab = ab.SetFlags(MyEnum.B | MyEnum.C, true);
            Assert.AreEqual(ab, MyEnum.A | MyEnum.B | MyEnum.C);
            ab = ab.SetFlags(MyEnum.B, false);
            Assert.AreEqual(ab, MyEnum.A | MyEnum.C);
        }
        [Flags]
        public enum MyEnum
        {
            None,
            A = 0x1,
            B = 0x2,
            C = 0x4,
            D = 0x8,
        }
    }
}
